/**
 * 强类型TS函数的重载
 */

message({
  mode: "mode",
  text: "text",
  onClose: function () {},
  duration: 3000
});
message("text");
message("text", function () {});
message("text", "mode");
message("text", "mode", 3000);
message("text", 3000);
message("text", 3000, function () {});

// 函数重载声明
function message(options: object): void;
function message(text: string, onClose?: Function): void;
function message(text: string, mode: string, duration?: number): void;
function message(text: string, duration: number, onClose?: Function): void;

// 函数实现
function message() {}
